/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package pkl53.view;

import java.awt.GridLayout;
import java.util.ArrayList;
import java.util.List;
import pkl53.model.B4Art;
import pkl53.model.B4Keteranganumumtenagakerja;
import pkl53.view.loop.Loop4A;
import pkl53.view.loop.Loop4B;

/**
 *
 * @author User
 */
public class Blok4B extends javax.swing.JPanel {
    Loop4B loop;
    private List <B4Keteranganumumtenagakerja> b4Keteranganumumlist= new ArrayList<B4Keteranganumumtenagakerja>();
    private List <B4Art> b4ArtList= new ArrayList<B4Art>();
    /**
     * Creates new form blok4
     */
    public Blok4B() {
        initComponents();
        initComponents();
        loop = new Loop4B();
        loopPanel.add(loop);
//        b4Keteranganumumlist.add(loop.getB4KeteranganumumModel());
//        b4ArtList.add(loop.getB4ArtModel());
        GridLayout grid = new GridLayout(20,1,0,0);
        loopPanel.setLayout(grid);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        blok4B1 = new pkl53.imageClass.BlokPekerja4B();
        jLayeredPane1 = new javax.swing.JLayeredPane();
        jPanel1 = new javax.swing.JPanel();
        tambahArtButton = new javax.swing.JButton();
        tambahPekerjaanButton = new javax.swing.JButton();
        loopPanel = new javax.swing.JPanel();

        setLayout(new java.awt.BorderLayout());

        jLayeredPane1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jPanel1.setBackground(new java.awt.Color(102, 102, 102));

        tambahArtButton.setText("Tambah Art");
        tambahArtButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tambahArtButtonActionPerformed(evt);
            }
        });

        tambahPekerjaanButton.setText("Tambah Pekerjaan");
        tambahPekerjaanButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tambahPekerjaanButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(1470, Short.MAX_VALUE)
                .addComponent(tambahPekerjaanButton, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(tambahArtButton, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addGap(3, 3, 3)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tambahArtButton)
                    .addComponent(tambahPekerjaanButton))
                .addContainerGap())
        );

        jLayeredPane1.add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(188, 445, 1760, 30));

        loopPanel.setOpaque(false);

        javax.swing.GroupLayout loopPanelLayout = new javax.swing.GroupLayout(loopPanel);
        loopPanel.setLayout(loopPanelLayout);
        loopPanelLayout.setHorizontalGroup(
            loopPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 1760, Short.MAX_VALUE)
        );
        loopPanelLayout.setVerticalGroup(
            loopPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 450, Short.MAX_VALUE)
        );

        jLayeredPane1.add(loopPanel, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 476, 1760, 450));

        javax.swing.GroupLayout blok4B1Layout = new javax.swing.GroupLayout(blok4B1);
        blok4B1.setLayout(blok4B1Layout);
        blok4B1Layout.setHorizontalGroup(
            blok4B1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLayeredPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 2097, Short.MAX_VALUE)
        );
        blok4B1Layout.setVerticalGroup(
            blok4B1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLayeredPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 1271, Short.MAX_VALUE)
        );

        add(blok4B1, java.awt.BorderLayout.CENTER);
    }// </editor-fold>//GEN-END:initComponents

    private void tambahArtButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tambahArtButtonActionPerformed
        // TODO add your handling code here:
        loop = new Loop4B();
        loopPanel.add(loop);
        loop.getB4R1().requestFocusInWindow();
        loop.getB4R1().setBounds(loop.getB4R1().getBounds().x-25,loop.getB4R1().getBounds().y,loop.getB4R1().getBounds().width,loop.getB4R1().getBounds().height);
        loop.getB4R1().getPanel().scrollRectToVisible(loop.getB4R1().getBounds());

//        getB4Keteranganumumlist().add(loop.getB4KeteranganumumModel());
//        getB4ArtList().add(loop.getB4ArtModel());

    }//GEN-LAST:event_tambahArtButtonActionPerformed

    private void tambahPekerjaanButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tambahPekerjaanButtonActionPerformed
        // TODO add your handling code here:
        loop = new Loop4B();
        loopPanel.add(loop);
        loop.getB4R1().requestFocusInWindow();
        loop.getB4R1().setBounds(loop.getB4R1().getBounds().x-25,loop.getB4R1().getBounds().y,loop.getB4R1().getBounds().width,loop.getB4R1().getBounds().height);
        loop.getB4R1().getPanel().scrollRectToVisible(loop.getB4R1().getBounds());

//        getB4Keteranganumumlist().add(loop.getB4KeteranganumumModel());
//        getB4ArtList().add(loop.getB4ArtModel());

    }//GEN-LAST:event_tambahPekerjaanButtonActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private pkl53.imageClass.BlokPekerja4B blok4B1;
    private javax.swing.JLayeredPane jLayeredPane1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel loopPanel;
    private javax.swing.JButton tambahArtButton;
    private javax.swing.JButton tambahPekerjaanButton;
    // End of variables declaration//GEN-END:variables

    /**
     * @return the b4Keteranganumumlist
     */
    public List <B4Keteranganumumtenagakerja> getB4Keteranganumumlist() {
        return b4Keteranganumumlist;
    }

    /**
     * @param b4Keteranganumumlist the b4Keteranganumumlist to set
     */
    public void setB4Keteranganumumlist(List <B4Keteranganumumtenagakerja> b4Keteranganumumlist) {
        this.b4Keteranganumumlist = b4Keteranganumumlist;
    }

    /**
     * @return the b4ArtList
     */
    public List <B4Art> getB4ArtList() {
        return b4ArtList;
    }

    /**
     * @param b4ArtList the b4ArtList to set
     */
    public void setB4ArtList(List <B4Art> b4ArtList) {
        this.b4ArtList = b4ArtList;
    }
}
